package cuit.game.service;



import java.util.List;
import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import cuit.game.dao.PictureRespository;
import cuit.game.entity.Picture;
import jakarta.transaction.Transactional;

@Service
@Transactional
public class PictureService {
	@Autowired
    PictureRespository pictureRespository;
	/**
     * 查找所有
     * @return
     */
    public List<Picture> findByUser_id(Long User_id){
    	return pictureRespository.findByUser_id(User_id);
    }
	public void save(Picture picture) {
		// 保存
		pictureRespository.save(picture);
	}
	public Picture findById(long id) {
		return pictureRespository.findById(id);
	}
	public List<Picture> findAll() {
		// TODO Auto-generated method stub
		return pictureRespository.findAll();
	}
}
